package com.wmx;

import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.junit.Test;

import java.text.ParseException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * @author wangMaoXiong
 * @version 1.0
 * @date 2021/1/22 10:11
 */
public class Wang {
    public static void main(String[] args) throws ParseException {
        String[] date_parse_patterns = {"yyyy-MM", "yyyy/MM", "yyyy-MM-dd", "yyyy/MM/dd",
                "yyyy-MM-dd HH:mm", "yyyy/MM/dd HH:mm", "yyyy-MM-dd HH:mm:ss", "yyyy/MM/dd HH:mm:ss"};
        String source = "2021-217";
        Date parseDate = DateUtils.parseDate(source, date_parse_patterns);
        System.out.println(parseDate);

        System.out.println(DateFormatUtils.format(parseDate, "yyyy-MM-dd HH:mm:ss"));

    }

    @Test
    public void test1() {
        List<Integer> list1 = new ArrayList<>();
        list1.add(1);
        list1.add(2);
        list1.add(3);
        list1.add(4);

        List<Integer> list2 = new ArrayList<>();
        list2.add(1);
        list2.add(3);
        list2.add(5);

        list1.removeAll(list2);
        System.out.println(list1);
        System.out.println(list2);
    }


}
